Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade VTMGO REST API to version 12 #325

Merged
merged 3 commits into from
Jun 1, 2022

Conversation

CasvanDongen
Copy link
Contributor

Changes for the plugin to be compatible with version 12 of the VTM GO api since 11 has been deprecated.

This PR fixes the issues from #324

@michaelarnauts
Copy link
Collaborator

@CasvanDongen you are fast! :)

@CasvanDongen
Copy link
Contributor Author

CasvanDongen commented Jun 1, 2022

I've also committed the changes to the requirements.txt which I had to make locally to be able to install the required packages.

@@ -45,7 +45,7 @@ def _mode(self):
def get_config(self):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you don't use self anymore, you should now remove it and mark it as a staticmethod. This way pylint stays happy.

    @staticmethod
    def get_config():

@michaelarnauts
Copy link
Collaborator

I've tried to run the test locally, but I still get some errors. You won't get correct test results here, since your repository doesn't have the required credentials as configured secrets.

You can however run them locally, if you copy .env.example to .env en use pipenv or something to load them before running the tests. You should be able to get the ADDON_TOKEN and ADDON_PROFILE from the json file that is created in the Kodi addon_data folder.

@michaelarnauts
Copy link
Collaborator

Hmm, maybe it's an issue on my end. The test fails to play VTM2 livestream, it is complaining that i'm geoblocked, but VTM1 works fine.

@CasvanDongen
Copy link
Contributor Author

Thanks for the quick review. I've annotated the get_config method static.

I've already ran the testsuite and locally I'm not seeing any failed tests on version 3.6 and 3.8 with a fresh valid token.

collected 28 items

tests/test_api.py::TestApi::test_get_config PASSED                                                                                          [  3%]
tests/test_api.py::TestApi::test_live PASSED                                                                                                [  7%]
tests/test_api.py::TestApi::test_mylist PASSED                                                                                              [ 10%]
tests/test_api.py::TestApi::test_recommendations PASSED                                                                                     [ 14%]
tests/test_api.py::TestApi::test_search PASSED                                                                                              [ 17%]
tests/test_auth.py::TestAuth::test_authorization PASSED                                                                                     [ 21%]
tests/test_auth.py::TestAuth::test_login PASSED                                                                                             [ 25%]
tests/test_epg.py::TestEpg::test_get_broadcast PASSED                                                                                       [ 28%]
tests/test_epg.py::TestEpg::test_get_epg PASSED                                                                                             [ 32%]
tests/test_iptvmanager.py::TestIptvManager::test_channels PASSED                                                                            [ 35%]
tests/test_iptvmanager.py::TestIptvManager::test_epg PASSED                                                                                 [ 39%]
tests/test_manifest_rewrite.py::TestManifestRewrite::test_rewrite PASSED                                                                    [ 42%]
tests/test_routing.py::TestRouting::test_catalog_continuewatching_menu PASSED                                                               [ 46%]
tests/test_routing.py::TestRouting::test_catalog_mylist_menu PASSED                                                                         [ 50%]
tests/test_routing.py::TestRouting::test_catalog_program_menu PASSED                                                                        [ 53%]
tests/test_routing.py::TestRouting::test_catalog_program_season_menu PASSED                                                                 [ 57%]
tests/test_routing.py::TestRouting::test_catalog_recommendations_menu PASSED                                                                [ 60%]
tests/test_routing.py::TestRouting::test_channels_menu PASSED                                                                               [ 64%]
tests/test_routing.py::TestRouting::test_index PASSED                                                                                       [ 67%]
tests/test_routing.py::TestRouting::test_login_menu PASSED                                                                                  [ 71%]
tests/test_routing.py::TestRouting::test_main_menu PASSED                                                                                   [ 75%]
tests/test_routing.py::TestRouting::test_play_epg PASSED                                                                                    [ 78%]
tests/test_routing.py::TestRouting::test_play_episode PASSED                                                                                [ 82%]
tests/test_routing.py::TestRouting::test_play_livetv PASSED                                                                                 [ 85%]
tests/test_routing.py::TestRouting::test_play_movie PASSED                                                                                  [ 89%]
tests/test_routing.py::TestRouting::test_search_menu PASSED                                                                                 [ 92%]
tests/test_routing.py::TestRouting::test_tvguide_menu PASSED                                                                                [ 96%]
tests/test_service.py::TestService::test_service PASSED                                                                                     [100%]

Since I'm being geo-blocked by VTM I do have to use a little trick to be able to receive data from the stream API. But that shouldn't be an issue for these tests.

@michaelarnauts
Copy link
Collaborator

It seems to be related to my IPv6 address. They seem to think that it's not a Belgian IP address.

@michaelarnauts michaelarnauts merged commit d5bf633 into add-ons:master Jun 1, 2022
@michaelarnauts
Copy link
Collaborator

Thanks! I'll create a new release with your fix.

@michaelarnauts michaelarnauts added the bug Something isn't working label Jun 1, 2022
@michaelarnauts michaelarnauts added this to the v1.3.1 milestone Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants